from selenium.webdriver.common.by import By
from pages.base_page import BasePage
from config.config import HOST
"""客户统计页面的操作"""


class ClientCountPage(BasePage):
    url='http://{}/crm/index.php?m=customer&a=analytics'.format(HOST)
    # 点击客户情况统计
    click_client_state_count_locator = (By.CSS_SELECTOR, '#show_scale')
    # 点击客户来源统计
    click_source_count_picture_locator = (By.CSS_SELECTOR, '#show_source')


    def click_client_state_count(self):
        """点击客户统计报表"""
        self.driver.find_element(*self.click_client_state_count_locator).click()


    def click_source_count_picture(self):
        """点击来源统计图"""
        self.driver.find_element(*self.click_source_count_picture_locator).click()


    def get_client_count_url(self):
        """获取当前页面url"""
        return self.current_url()